import request from '@/utils/request'

// 查询主播列表
export function listAnchor(data) {
  return request({
    url: '/sys/anchor/getAll',
    method: 'post',
    data: data
  })
}

// 查询主播详细
export function getAnchor(id) {
  return request({
    url: `/sys/anchor/getById?id=${id}`,
    method: 'get'
  })
}

// 新增主播
export function addAnchor(data) {
  return request({
    url: '/car/anchor',
    method: 'post',
    data: data
  })
}

// 修改主播
export function updateAnchor(data) {
  return request({
    url: '/car/anchor',
    method: 'put',
    data: data
  })
}

// 删除主播
export function delAnchor(data) {
  return request({
    url: '/sys/anchor/delete',
    method: 'post',
    data:data
  })
}
// 冻结身份
export function anchorStatusChange(id) {
  return request({
    url: '/sys/anchor/frozenAnchor?id=' + id,
    method: 'get'
  })
}
// 冻结身份
export function anchorAudit(data) {
  return request({
    url: '/sys/anchor/apply/approve',
    method: 'post',
    data:data
  })
}
//结算配置
export function settlementAllocation(data) {
  return request({
    url: '/sys/anchor/settlementAllocation',
    method: 'post',
    data:data
  })
}

//开启-关闭带货任务权限
export function taskAuthority(id) {
  return request({
    url: `/sys/anchor/taskAuthority/${id}`,
    method: 'post',
  })
}

//开启-关闭带货娱乐直播权限
export function liveEntertainment(id) {
  return request({
    url: `/sys/anchor/liveEntertainment/${id}`,
    method: 'post',
  })
}

